Temenos Digital
Min(s) read

Problem Statement - Excessive Information Exposed

These updates are applicable for releases - 2021.04, 2021.07, 2021.10, 2022.07, 2022.10, 2023.01, 2023.07, 2023.10.

This document provides a solution to prevent the exposure of excessive information. Refer to the below sections for more details.

Description

Excessive information exposure is a vulnerability that occurs when an application or system exposes too much information to users or attackers. This can include sensitive information, system configuration details, or other data that can be used to launch further attacks or gain unauthorized access to the system.

User attributes from service instead of provider token

Path:

Visualizer/AuthenticationMA/mvcextensions/AuthUIModule/PresentationControllers/PresentationController.js

After completion of AuthPresentationController.prototype.initializePermissions = function () the highlighted function, please add the below line of the code,

AuthPresentationController.prototype.getUserandSecurityAttributes = function(Callback) {
    // Getting the user and security attributes from identity response.
    var userAttributes, securityAttributes;
    var param = {};
    var authClient = KNYMobileFabric.getIdentityService(applicationManager.getConfigurationManager().constants.IDENTITYSERVICENAME);

  authClient.getSecurityAttributes(function(data) {
    securityAttributes = data;
    param.securityAttributes = securityAttributes;
  }, function(err) {
    kony.print("Error getting User attributes");
  });

  this.getUserAttributes(Callback,param);
};

AuthPresentationController.prototype.getUserAttributes = function(callback, param) {
const authManger = applicationManager.getAuthManager();
let userattributes = authManger.getUserAttributes(this.userAttributesSuccessCallback.bind(this,callback,param), this.userAttributesErrorCallback);
};
AuthPresentationController.prototype.userAttributesSuccessCallback = function(callback,param,res) {
param.userAttributes=res;
callback(param);
}; 

AuthPresentationController.prototype.userAttributesErrorCallback = function(error) {
applicationManager.getPresentationUtility().dismissLoadingScreen();
kony.print("userAttributesErrorCallback");
};

Handling DBX API Identity Service User Attributes

Path:

Fabric/java/DBPCommonUtilityServices/src/main/java/com/kony/dbputilities/util/HelperMethods.java

Package : com.kony.dbputilities.util

Class: HelperMethods

In all the snippets, red indicates removed or modified content, while green indicates added or replaced content.

SRC
HelperMethods

Please add the following method to the class mentioned below as shown in the above snipshot,

 public static Map<String, Object> getIdentityServiceInfo(DataControllerRequest dcRequest) {
    String sessionToken = "";
    IdentityHandler identityHandler = null;

    try {
        if (dcRequest.getServicesManager() != null && dcRequest.getServicesManager().getIdentityHandler() != null) {
            identityHandler = dcRequest.getServicesManager().getIdentityHandler();
            if (identityHandler != null) {
                sessionToken = identityHandler.getSecurityAttributes().get("session_token").toString();
            }
        }
    } catch (Exception e) {
        LOG.error(e.getMessage());
    }

    try {
        if (StringUtils.isBlank(sessionToken)) {
            Result userAttributesResponse = callApi(dcRequest, null, getHeaders(dcRequest), URLConstants.USER_ATTRIBUTES_GET_IDENTITY);
            if (userAttributesResponse.getNameOfAllParams().contains("session_token")) {
                sessionToken = userAttributesResponse.getParamValueByName("session_token");
            }
        }
    } catch (HttpCallException e) {
        LOG.error(e.getMessage());
    }

    Map<String, Object> identityInfo = new HashMap<>();
    try {
        identityInfo.put("session_token", sessionToken);
        if (identityHandler != null) {
            identityInfo.putAll(identityHandler.getUserAttributes());
        }
    } catch (Exception e) {
        LOG.debug("Error in fetching Identity user attributes", e);
    }

    return identityInfo;
}

Along with this replacement please add the below import statement.

import com.konylabs.middleware.api.processor.IdentityHandler;

Path:

Fabric/java/DBPCommonUtilityServices/src/main/java/com/temenos/dbx/product/utils/CustomerSessionsUtil.java

Package: com.temenos.dbx.product.utils

Class: CustomerSessionsUtil

Method1: getLoggedInUserAttributesMap

Method 2: formatUserAttributeRecordtoMap

customersessions
Step 1
customersessions1
Step 2

Please remove the code from Map<string, object>. Params to return formatUserAttributeRecordtoMap(result);

Map<String, Object> params = new HashMap<>();

Result result = ServiceCallHelper.invokeServiceAndGetResult(
    params, 
    HelperMethods.getHeaders(dcRequest), 
    URLConstants.GET_USER_ATTRIBUTES, 
    dcRequest.getHeader("x-kony-authorization")
);

return formatUserAttributeRecordToMap(result);

Please add the below code changes as shown in snip above:

{
            Map<String, Object> resultMap = new HashMap<>();
            try {
                Result result = ServiceCallHelper.invokeServiceAndGetResult(new HashMap<>(),
                        HelperMethods.getHeaders(dcRequest), URLConstants.GET_USER_ATTRIBUTES,
                        dcRequest.getHeader("x-kony-authorization"));
                resultMap = formatUserAttributeRecordtoMap(result);
            } catch (HttpCallException e) {
                LOG.debug("Error occured while fetching user attributes.. ");
            }

            if (resultMap.isEmpty()) {
          return 
			dcRequest.getServicesManager().getIdentityHandler().getUserAttributes();
            }

            return resultMap;
        }

In formatUserAttributeRecordtoMap method make changes as per the below snip:

attribute record
Attribute Record

As shown in above snip remove the below lines:

for (Param param : userAttributeRecord.getAllParams()) {
            userAttributesMap.put(param.getName(), param.getValue());

Add the below code changes as shown in above snip:

if (userAttributeRecord != null) {
            for (Param param : userAttributeRecord.getAllParams()) {
                userAttributesMap.put(param.getName(), param.getValue());
            }

Along with this replacement please add the below import statement.

import com.kony.dbputilities.exceptions.HttpCallException;

Path:

Fabric/java/eum-productservices/src/main/java/com/temenos/dbx/eum/product/usermanagement/javaservice/GetUserAttributesOperation.java

Package : com.temenos.dbx.eum.product.usermanagement.javaservice

Class: GetUserAttributesOperation

Method: invoke

usermanagement

usermanagement
Step 1
usermanagement1
Step 2

As shown in the above snips, remove the following code,

String session_token = HelperMethods.getSessionTokenFromIdentityService(request);
            String serviceRespcache = (String) MemoryManager.getFromCache(session_token + "_USER_ATTRIBUTES");

As shown in the above snips, Add the following code,

Map<String, Object> identityInfo = HelperMethods.getIdentityServiceInfo(request);
            
            String sessiontoken = "";
            if (identityInfo.containsKey("CustomerType_id") && identityInfo.get("CustomerType_id") != null
                    && identityInfo.get("CustomerType_id").toString().equalsIgnoreCase("DBP_API_USER"))
                return result;
            if (identityInfo.containsKey("session_token") && identityInfo.get("session_token") != null) {
                sessiontoken = identityInfo.get("session_token").toString();
            }

            String serviceRespcache = (String) MemoryManager.getFromCache(sessiontoken + "_USER_ATTRIBUTES");

Remove and add the code as shown in the below snip respectively,

attributesoperation
Attributes Operation

Remove :

MemoryManager.saveIntoCache(session_token + "_USER_ATTRIBUTES", userAttributes, EXPIRY_TIME);

Add this code:

MemoryManager.saveIntoCache(sessiontoken + "_USER_ATTRIBUTES", userAttributes, EXPIRY_TIME);

Along with this replacement please add the below import statement.

import java.util.Map;

Create a new integration service for user attributes

Path: Fabric/java/com.temenos.infinity.t24irisintegration/src/main/java/com/infinity/dbx/temenos/user/GetUserJavaPreProcessor.java

Package: com.infinity.dbx.temenos.user

Class: GetUserJavaPreProcessor

Method: execute

In all the snippets, red indicates removed or modified content, while green indicates added or replaced content.

As you can see in below snipshot. Please modify the code from identityhandler to customerSessionsUtil.

customer session
Customer Session Util

Please search with identityHandler.getUserAttributes() in the above mentioned method as per above snip and replace with the below given line.

Map<String, Object> userAttributes = CustomerSessionsUtil.getLoggedInUserAttributesMap(request);

Along with this replacement please add the below import statement.

import com.temenos.dbx.product.utils.CustomerSessionsUtil;

Path: Fabric/java/com.temenos.infinity.t24irisintegration/src/main/java/com/infinity/dbx/temenos/user/UpdateUserDetailsPreProcessor.java

Package: com.infinity.dbx.temenos.user

Class: UpdateUserDetailsPreProcessor

Method: execute

As you can see in below snipshot. Please modify the code from identityhandler to customerSessionsUtil.

Blame
Blame

Please search with identityHandler.getUserAttributes() in the above mentioned method as per above snip and replace with the below given line.

Map<String, Object> userAttributes = CustomerSessionsUtil.getLoggedInUserAttributesMap(request);

Along with this replacement please add the below import statement.

import com.temenos.dbx.product.utils.CustomerSessionsUtil;

Path:

Fabric/java/DBPAdminIntegration/src/main/java/com/kony/AdminConsole/BLProcessor/CreateCardRequest.java

Package: com.kony.AdminConsole.BLProcessor

Class: CreateCardRequest

Method: invoke

As you can see in below snipshot. Please modify the code from line 27 and 28 and replace it with given below line

String Username = (String) CustomerSessionsUtil.getLoggedInUserAttributesMap(requestInstance).get("UserName");

Along with this replacement please add the below import statement.

import com.temenos.dbx.product.utils.CustomerSessionsUtil;
createcardrequest
Create Card Request

Path:

Fabric/java/DBPAdminIntegration/src/main/java/com/kony/AdminConsole/BLProcessor/SetAlertPreferences.java

Package: com.kony.AdminConsole.BLProcessor

Class: SetAlertPreferences

Method: getCoreBackendId

As shown in the snipshot, please update the code at lines 182-183 as follows:

Setalert
Set Alert

Replace the existing lines:

Map<String, Object> userAttributesMap = dcreq.getServicesManager().getIdentityHandler().getUserAttributes();

With the following line:

Map<String, Object> userAttributesMap = CustomerSessionsUtil.getLoggedInUserAttributesMap(dcreq);

Also, add the following import statement at the beginning of the file:

import com.temenos.dbx.product.utils.CustomerSessionsUtil;

Path:

Fabric/java/DBPCommonUtilityServices/src/main/java/com/kony/dbputilities/util/AdminUtil.java

Package: com.kony.dbputilities.util

Class: AdminUtil

Method: addAdminUserNameRoleIfAvailable, addAdminUserNameRoleIfAvailable

Modification Instructions:

As shown in the snipshot, please update the code at lines 459-460 as follows:

  • Replace the existing line:
Map<String, Object> userAttributes = dcRequest.getServicesManager().getIdentityHandler().getUserAttributes();

With the following line:

Map<String, Object> userAttributes = CustomerSessionsUtil.getLoggedInUserAttributesMap(dcRequest);

This change reflects the updated method for retrieving user attributes using the CustomerSessionsUtil utility.

If you also need to add the relevant import statement, it should be:

import com.temenos.dbx.product.utils.CustomerSessionsUtil;

Please find the below snipshot for reference.

admin util
Step 1
admin util
Step 2

Modification Instructions For Above Snip:

As shown in the snipshot, please update the code at lines 488-489 as follows:

  • Replace the existing line:
Map<String, Object> userAttributes = dcRequest.getServicesManager().getIdentityHandler().getUserAttributes();

With the following line:

Map userAttributes =CustomerSessionsUtil.getLoggedInUserAttributesMap(requestManager);

Path:

Fabric/java/DBPCommonUtilityServices/src/main/java/com/kony/dbputilities/util/ErrorCodeEnum.java

Package: com.kony.dbputilities.util

Class: ErrorCodeEnum

Please add the below errorcode as per snip.

ERR_10820(10820, "Backend failed to get user attributes"),
error code
Error Code

Path:

Fabric/java/DBPCommonUtilityServices/src/main/java/com/kony/dbputilities/util/HelperMethods.java

Package: com.kony.dbputilities.util

Class: HelperMethods

If you also need to add the relevant import statement, it should be:

import com.temenos.dbx.product.utils.CustomerSessionsUtil;
import com.konylabs.middleware.controller.DataControllerResponse;
import com.konylabs.middleware.dataobject.ResultToJSON;
import com.temenos.dbx.product.dto.CustomerDTO;
import com.temenos.dbx.product.utils.CustomerSessionsUtil;

In getCustomerFromAPIIdentityService method please replace

Map<String, Object>  hashMap = dcRequest.getServicesManager().getIdentityHandler().getUserAttributes();

With

Map<String, Object>  hashMap = CustomerSessionsUtil.getLoggedInUserAttributesMap(dcRequest);

In getUserFromIdentityService method please replace

Map<String, Object>  hashMap = dcRequest.getServicesManager().getIdentityHandler().getUserAttributes();

With

Map<String, Object>  hashMap = CustomerSessionsUtil.getLoggedInUserAttributesMap(dcRequest);

In getCustomerFromIdentityService method please replace

Map<String, Object>  hashMap = dcRequest.getServicesManager().getIdentityHandler().getUserAttributes();

With

Map<String, Object>  hashMap = CustomerSessionsUtil.getLoggedInUserAttributesMap(requestManager);

In getCustomerFromAPIIdentityService method please replace

Map<String, Object>  hashMap = fabricRequestManager.getServicesManager().getIdentityHandler().getUserAttributes();

With

Map<String, Object>  hashMap =CustomerSessionsUtil.getLoggedInUserAttributesMap(fabricRequestManager);

In isPSD2Agent method please replace

String userAgentType = request.getServicesManager().getIdentityHandler().getUserAttributes()

With

String userAgentType = CustomerSessionsUtil.getLoggedInUserAttributesMap(request)

Add this below given method,

public static String getDeviceId(DataControllerRequest dcRequest) {

    String reportingParams = dcRequest.getHeader(DBPUtilitiesConstants.X_KONY_REPORTING_PARAMS);
    try {
        reportingParams = URLDecoder.decode(reportingParams, StandardCharsets.UTF_8.name());
    } catch (Exception e) {
        LOG.error("Caught exception while Decoding Reporting Params : ", e);
    }

    JSONObject jsonObject = new JSONObject();
    try {
        jsonObject = new JSONObject(reportingParams);

        if (reportingParams.contains("did")) {

            return jsonObject.getString("did");
        }
    } catch (Exception e) {
        LOG.error("Caught exception while Getting DeviceId from reporting Params: ", e);
    }

    return "";
}

Path:

Fabric/java/DBPCommonUtilityServices/src/main/java/com/kony/dbputilities/util/URLConstants.java

Package: com.kony.dbputilities.util

Class: URLConstants

Please add the below given line as per the snip.

public static final String GET_USER_ATTRIBUTES = "get_user_attributes";
url constants
Url Constants

Path:

Fabric/java/DBPCommonUtilityServices/src/main/java/com/temenos/dbx/product/utils/CustomerSessionsUtil.java

Package: com.temenos.dbx.product.utils

Class: CustomerSessionsUtil

Please add the given below methods

/*
* 1) All projects which depends on user attributes will call this method 2)
* This method will call java integrationservice to get user attibutes 3) this
* is for dcrequest
*/
public static Map getLoggedInUserAttributesMap(DataControllerRequest dcRequest) throws Exception {
Map params = new HashMap<>();

Result result = ServiceCallHelper.invokeServiceAndGetResult(params, HelperMethods.getHeaders(dcRequest), URLConstants.GET_USER_ATTRIBUTES,
dcRequest.getHeader("x-kony-authorization"));
return formatUserAttributeRecordtoMap(result);
}

/*
* 1) All projects which depends on user attributes will call this method 2)
* This method will call java integrationservice to get user attibutes 3) this
* is for request manager
*/

public static Map getLoggedInUserAttributesMap(FabricRequestManager requestManager)
throws Exception {
Map params = new HashMap<>();
Result result = ServiceCallHelper.invokeServiceAndGetResult(params, HelperMethods.getHeaders(requestManager), URLConstants.GET_USER_ATTRIBUTES,
requestManager.getHeadersHandler().getHeader("x-kony-authorization"));
return formatUserAttributeRecordtoMap(result);
}

public static Map formatUserAttributeRecordtoMap(Result result) throws Exception {

Record userAttributeRecord = result.getRecordById(DBPUtilitiesConstants.USR_ATTR);
Map userAttributesMap = new HashMap();
for (Param param : userAttributeRecord.getAllParams()) {
userAttributesMap.put(param.getName(), param.getValue());
}
return userAttributesMap;
}

If you also need to add the relevant import statement, it should be:

import org.apache.log4j.Logger;
import com.kony.dbputilities.util.DBPUtilitiesConstants;
import com.kony.dbputilities.util.HelperMethods;
import com.konylabs.middleware.api.processor.manager.FabricRequestManager;
import com.konylabs.middleware.dataobject.Param;
import com.konylabs.middleware.dataobject.Record;

Along with these please add the below line as per snip

private static final Logger LOG = Logger.getLogger(CustomerSessionsUtil.class);
customersessions
Customer Sessions

Path:

Fabric/java/DBPCommonUtilityServices/src/main/resources/DBPServiceURLs.properties

Package: resources (Property file, no class)

Property File: DBPServiceURLs.properties

Please add the below line as per the snip

get_user_attributes = /services/data/v1/ExternalUserManagement/operations/ExternalUsers/getUserAttributes
dbpservices
DBP Services

Path: Fabric/java/DBPProductServices/src/main/java/com/kony/dbputilities/customersecurityservices/InitializeIdentityOnLogin.java

Package: com.kony.dbputilities.customersecurityservices

Class: InitializeIdentityOnLogin

Method: invoke

customersecurityservices
Customer Security Services

Modification Instructions For Above Snip:

As shown in the snipshot, please update the code at lines 488-489 as follows:

Replace the existing line:

identityHandler.getUserAttributes();

With the following line:

CustomerSessionsUtil.getLoggedInUserAttributesMap(request);

If you also need to add the relevant import statement, it should be:

import com.temenos.dbx.product.utils.CustomerSessionsUtil;

Path: Fabric/java/DBPProductServices/src/main/java/com/temenos/dbx/product/accountsstatement/javaservices/GenerateCombinedStatementFile.java

Package: com.temenos.dbx.product.accountsstatement.javaservices

Class: GenerateCombinedStatementFile

Method: invoke

ACCOUNT STATEMENT
Account Statement

Modification Instructions For Above Snip:

As shown in the snipshot, please update the code at lines 488-489 as follows:

Replace the existing line:

String companyId = (String) dcRequest.getServicesManager().getIdentityHandler().getUserAttributes()

With the following line:

String companyId = (String) CustomerSessionsUtil.getLoggedInUserAttributesMap(dcRequest)

If you also need to add the relevant import statement, it should be:

import com.temenos.dbx.product.utils.CustomerSessionsUtil;

Path:

Fabric/java/DBPProductServices/src/main/java/com/temenos/dbx/product/commonsutils/CustomerSession.java

Package: com.temenos.dbx.product.commonsutils

Class: CustomerSession

Method: getCustomerMap

get customer map
Customer Map
Please replace the whole try and catch block with below lines of code.
try {
			Map<String, Object> customer = null;
			try {
				customer = CustomerSessionsUtil.getLoggedInUserAttributesMap(request);
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			return customer;
		} catch (NullPointerException e) {
			LOG.error(e);
		}
		 return null;
	}

If you also need to add the relevant import statement, it should be:

import com.temenos.dbx.product.utils.CustomerSessionsUtil;

Path: Fabric/java/DBPProductServices/src/main/java/com/temenos/dbx/product/usermanagement/resource/impl/InfinityUserManagementResourceImpl.java

Package: com.temenos.dbx.product.usermanagement.resource.impl

Class: InfinityUserManagementResourceImpl

Method: createCustomRole

contractvalidation
Contract Validation

Modification Instructions For Above Snip:

As shown in the snipshot, please update the code at lines 488-489 as follows:

Replace the existing line:

String name = (String) request.getServicesManager().getIdentityHandler().getUserAttributes() 

With the following line:

String name = (String) CustomerSessionsUtil.getLoggedInUserAttributesMap(request)

If you also need to add the relevant import statement, it should be:

import com.temenos.dbx.product.utils.CustomerSessionsUtil;

Path:

Fabric/java/eum-productservices/src/main/java/com/kony/eum/dbputilities/customersecurityservices/CustomerLogin.java

Package: com.kony.eum.dbputilities.customersecurityservices

Class: CustomerLogin

Method : postProcessForPin

post process
Post Process

Modification Instructions For Above Snip:

As shown in the snipshot, please update the code at lines 488-489 as follows:

Replace the existing line:

String deviceId = getDeviceId(dcRequest);

With the following line:

String deviceId = HelperMethods.getDeviceId(dcRequest);
append
append

Here as per above snip in line 579 Please make method as static

Please Remove method getDeviceId from customerLogin.class

decoding
Decoding

Method : sessionAttributes

dc request
Dc Request

Modification Instructions For Above Snip:

As shown in the snipshot, please update the code at lines 702-704 as follows:

Replace the existing line:

if (StringUtils.isNotBlank(getDeviceId(dcRequest)))

With the following line:

if (StringUtils.isNotBlank(HelperMethods.getDeviceId(dcRequest)))

and

Replace the existing line:

isDeviceRegistered(dcRequest, getDeviceId(dcRequest), inputParams.get("id")) + ""));

With the following line:

isDeviceRegistered(dcRequest, HelperMethods.getDeviceId(dcRequest),           inputParams.get("id")) + ""));

Path:

Fabric/java/eum-productservices/src/main/java/com/temenos/dbx/eum/product/usermanagement/javaservice/GetUserAttributesOperation.java

Package: com.temenos.dbx.eum.product.usermanagement.javaservice;

Please create the below class GetUserAttributesOperation.java

package com.temenos.dbx.eum.product.usermanagement.javaservice;
 
import org.apache.commons.lang3.StringUtils;
 
import org.apache.logging.log4j.LogManager;
 
import org.apache.logging.log4j.Logger;
 
import com.dbp.core.api.factory.impl.DBPAPIAbstractFactoryImpl;
 
import com.kony.dbp.exception.ApplicationException;
 
import com.kony.dbputilities.memorymanagement.MemoryManager;
 
import com.kony.dbputilities.util.HelperMethods;
 
import com.konylabs.middleware.common.JavaService2;
 
import com.konylabs.middleware.controller.DataControllerRequest;
 
import com.konylabs.middleware.controller.DataControllerResponse;
 
import com.konylabs.middleware.dataobject.JSONToResult;
 
import com.konylabs.middleware.dataobject.Result;
 
import com.konylabs.middleware.dataobject.ResultToJSON;
 
import com.temenos.dbx.eum.product.usermanagement.javaservice.GetUserAttributesOperation;
 
import com.temenos.dbx.eum.product.usermanagement.resource.api.CustomerIdentityAttributesResource;
 
public class GetUserAttributesOperation implements JavaService2 {
 
    private static final Logger LOG = LogManager.getLogger(GetUserAttributesOperation.class);
 
    private static final int EXPIRY_TIME = (20 * 60);
 
    /*
 
     * 1)look for cache if user attributes are available 2) if available it will
 
     * return UA 3) if not available then call resource.getUserAttributes and save
 
     * in cache and return
 
     */
 
    @Override
 
    public Object invoke(String methodID, Object[] inputArray, DataControllerRequest request,
 
            DataControllerResponse response) throws Exception {
 
        Result result = new Result();
 
        try {
 
            String session_token = HelperMethods.getSessionTokenFromIdentityService(request);
 
            String serviceRespcache = (String) MemoryManager.getFromCache(session_token + "_USER_ATTRIBUTES");
 
            if (StringUtils.isEmpty(serviceRespcache)) {
 
                CustomerIdentityAttributesResource resource = DBPAPIAbstractFactoryImpl
 
                        .getResource(CustomerIdentityAttributesResource.class);
 
                result = resource.getUserAttributes(methodID, inputArray, request, response);
 
                String userAttributes = ResultToJSON.convert(result);
 
                MemoryManager.saveIntoCache(session_token + "_USER_ATTRIBUTES", userAttributes, EXPIRY_TIME);
 
            } else {
 
                result = JSONToResult.convert(serviceRespcache);
 
            }
 
        } catch (ApplicationException e) {
 
            LOG.error("Exception occured in GetUserAttributesOperation" , e);
 
        } catch (Exception e) {
 
            LOG.error("Exception occured in GetUserAttributesOperation" , e);
 
        }
 
        return result;
 
    }
 
}

Path:

Fabric/java/eum-productservices/src/main/java/com/temenos/dbx/eum/product/usermanagement/resource/api/CustomerIdentityAttributesResource.java

Package: com.temenos.dbx.eum.product.usermanagement.resource.api;

Class: CustomerIdentityAttributesResource

Please add the below lines as per below snip.

usermanagement
User Management
public Result getUserAttributes(String methodId, Object[] inputArray,
DataControllerRequest requestInstance, DataControllerResponse responseInstance) throws ApplicationException ;

Path:

Fabric/java/eum-productservices/src/main/java/com/temenos/dbx/eum/product/usermanagement/resource/impl/CustomerIdentityAttributesResourceImpl.java

Package: package com.temenos.dbx.eum.product.usermanagement.resource.impl;

Please modify the given class CustomerIdentityAttributesResourceImpl.java

Please refer the below note to replace the class.

citr
Customer Identity Attributes

Path:

Fabric/java/eum-productservices/src/main/java/com/temenos/dbx/eum/product/usermanagement/resource/impl/InfinityUserManagementResourceImpl.java

Package: com.temenos.dbx.eum.product.usermanagement.resource.impl;

Class: InfinityUserManagementResourceImpl.java

Method: createCustomRole

custom role
Custom Role

Modification Instructions For Above Snip:

As shown in the snipshot, please update the code at lines 2585-2586 as follows:

Replace the existing line:

String name = (String) request.getServicesManager().getIdentityHandler().getUserAttributes() 

With the following line:

String name = (String) CustomerSessionsUtil.getLoggedInUserAttributesMap(request)

If you also need to add the relevant import statement, it should be:

import com.temenos.dbx.product.utils.CustomerSessionsUtil;

Onlinebanking application client changes for modified user attributes

Path:

Fabric/java/DBPMFAServices/src/main/java/com/kony/dbputilities/mfa/LoginMFAUtil.java

Package: com.kony.dbputilities.mfa

Class: LoginMFAUtil

Method: checkAndAddMFAAttributes

In all the snippets, red indicates removed or modified content, while green indicates added or replaced content.

LoginMFA
Login MFA

Remove the following code as per the above snips in the method checkAndAddMFAAttributes:

boolean isDeviceRegistered = false;
if (dbxUsrAttr != null
                && dbxUsrAttr.getNameOfAllParams().contains(DBPUtilitiesConstants.IS_DEVICE_REGISTERED)) {
            isDeviceRegistered = dbxUsrAttr.getParamByName(DBPUtilitiesConstants.IS_DEVICE_REGISTERED).getValue()
                    .equalsIgnoreCase("true");
            logger.debug("IS_DEVICE_REGISTERED : " + isDeviceRegistered);
        }
login MFA1
Login MFA1

Remove the code give below as per the above snip:

if (isDeviceRegistered) {
                            dbxUsrAttr.addParam(new Param(DBPUtilitiesConstants.IS_DEVICE_REGISTERED, "true"));
                        } else {
                            dbxUsrAttr.addParam(new Param(DBPUtilitiesConstants.IS_DEVICE_REGISTERED, "false"));
                        }
MFA
MFA

Remove the code give below as per the above snip:

logger.debug("Device is registered " + isDeviceRegistered + " MFA Triggered :" + !isDeviceRegistered);
dbxUsrAttr.addParam(new Param(DBPUtilitiesConstants.IS_DEVICE_REGISTERED, "false"));

Path: Fabric/java/DBPProductServices/src/main/java/com/kony/dbputilities/customersecurityservices/postprocessors/CustomerLoginPostProcessor.java

Package: com.kony.dbputilities.customersecurityservices.postprocessors

Class: CustomerLoginPostProcessor

Method: getCustomerPermissions

customersecurityservices
Customer Security Services

In the getCustomerPermissions method, make the code changes as per the snip above:

Comment the following code as per the snipshot:

//securityAttr.addParam(new Param("permissions", getJSONString(actions), MWConstants.STRING));
//securityAttr.addParam(new Param("features", getJSONString(features), MWConstants.STRING));

//securityAttr.addParam(new Param("permissions", "[]", MWConstants.STRING));
//securityAttr.addParam(new Param("features", "[]", MWConstants.STRING));

Path: Fabric/java/DBPProductServices/src/main/java/com/temenos/dbx/product/approvalsframework/approvalsframeworkcommons/util/ApprovalUtilities.java

Package: com.temenos.dbx.product.approvalsframework.approvalsframeworkcommons.util

Class: ApprovalUtilities

Method: getCurrentLoggedInUserPermissions

approvals framework
Approvals Framework

Make the code change in the getCurrentLoggedInUserPermissions method, as per the above snip,

Remove the following code,

try {
    Map<String, Object>  customerSecurityAttributes = request.getServicesManager().getIdentityHandler().getSecurityAttributes();
            permissionsObj = customerSecurityAttributes.get("permissions");
        }
        catch (Exception e) {
            LOG.error("Failed to get customer id from customerSecurityAttributes");
            LOG.debug("Failed to get customer id from customerSecurityAttributes" + e);
        }

approvalutilities
Approval Utilities

Remove the following code, as per the above snip:

LOG.error("Failed to get customer id from customerSecurityAttributes");
LOG.debug("Failed to get customer id from customerSecurityAttributes" + e);

Add the below code changes as per the above snipshot,

LOG.error("Failed to get customer id from customerSecurityAttributes" , e);
LOG.debug("Failed to get customer id from customerSecurityAttributes" , e);

Path:

Fabric/java/DBPProductServices/src/main/java/com/temenos/dbx/product/commonsutils/CustomerSession.java

Package: com.temenos.dbx.product.commonsutils

Class: CustomerSession

Method1: getPermittedActionIds

customer sessions
Customer Sessions

In the getPermittedActionIds method, make the code changes as given in the snip above,

Remove the following code as per snip,

Map<String, Object>  customerSecurityAttributes = request.getServicesManager().getIdentityHandler().getSecurityAttributes();
            //Object permissionsObj = customerSecurityAttributes.get("permissions");
            Object permissionsObj = ApprovalUtilities.getCurrentLoggedInUserPermissions(request);

Add the following code as per the above snips,

JSONObject featuresAndpermissionsObj = LegalEntityUtil.getUserCurrentLegalEntityFeaturePermissions(request);
            Object permissionsObj =  featuresAndpermissionsObj.get("permissions");  
login service
Login Service

Remove the following code as per the above snip, in the getPermittedActionIds method,

catch (MiddlewareException e) {
            LOG.error("Error while fetching customer attributes from the identity session", e);
        }

Method 2: getPermittedActionIdsSet:

In the getPermittedActionIdsSet method make the changes as per the snipshot,

commonsutil
Commons util

Remove the following code, as per the snip,

Map<String, Object>  customerSecurityAttributes = request.getServicesManager().getIdentityHandler().getSecurityAttributes();
            Object permissionsObj = customerSecurityAttributes.get("permissions");

Add the following code, as per the snip,

JSONObject featuresAndpermissionsObj = LegalEntityUtil.getUserCurrentLegalEntityFeaturePermissions(request);
            Object permissionsObj =  featuresAndpermissionsObj.get("permissions");  
Identity session
Identity session

Remove the following code as per the above snip,

catch (MiddlewareException e) {
            LOG.error("Error while fetching customer attributes from the identity session", e);
        }

Along with this replacement please add the below import statement.

import org.json.JSONObject;

Path:

Fabric/java/eum-productservices/src/main/java/com/kony/eum/dbputilities/customersecurityservices/CustomerLogin.java

Package: com.kony.eum.dbputilities.customersecurityservices

Class: CustomerLogin

Method: sessionAttributes

customerlogin java
Customer Login

Remove the following code in the sessionAttributes method, as per the above snipshot,

usrAttr.addParam(new Param("UserName", HelperMethods.getFieldValue(result, "UserName"), "String"));
Result cusComm = new Result();

        inputParams.put("id", HelperMethods.getFieldValue(result, "id"));

        if (StringUtils.isNotBlank(HelperMethods.getDeviceId(dcRequest))) {
            usrAttr.addParam(new Param(DBPUtilitiesConstants.IS_DEVICE_REGISTERED,
                    isDeviceRegistered(dcRequest, HelperMethods.getDeviceId(dcRequest), inputParams.get("id")) + ""));
        }

        cusComm = (Result) new GetCustomerPreferencesConcurrent().invoke(methodID, inputArray, dcRequest, dcResponse);

        logger.debug("Response from CustomerPreferencesConcurrent : " + ResultToJSON.convert(cusComm));
        for (Param param : cusComm.getAllParams()) {
            usrAttr.addParam(param);
        }

        usrAttr.addParam("userFirstName", usrAttr.getParamValueByName("FirstName"));
        usrAttr.addParam("userLastName", usrAttr.getParamValueByName("LastName"));
        usrAttr.addParam("gender", usrAttr.getParamValueByName("Gender"));
        usrAttr.addParam("isPinSet", usrAttr.getParamValueByName("IsPinSet"));
        usrAttr.addParam("noofdependents", usrAttr.getParamValueByName("NoOfDependents"));
        usrAttr.addParam("spousefirstname", usrAttr.getParamValueByName("SpouseName"));
        usrAttr.addParam("userImage", usrAttr.getParamValueByName("UserImage"));
        usrAttr.addParam("ssn", usrAttr.getParamValueByName("Ssn"));
        usrAttr.addParam("taxid", usrAttr.getParamValueByName("Ssn"));
        usrAttr.addParam("maritalstatus", usrAttr.getParamValueByName("MaritalStatus_id"));
        usrAttr.addParam("lastlogintime", usrAttr.getParamValueByName("Lastlogintime"));
        usrAttr.addParam("isCombinedUser", usrAttr.getParamValueByName("isCombinedUser"));
        usrAttr.addParam("organizationType", usrAttr.getParamValueByName("organizationType"));
        usrAttr.addParam(new Param("CSR_User_Id",
                StringUtils.isNotBlank(dcRequest.getAttribute("CSR_User_Id")) ? dcRequest.getAttribute("CSR_User_Id")
                        : "",
                "String"));
        usrAttr.addParam(new Param("CSR_Role",
                StringUtils.isNotBlank(dcRequest.getAttribute("CSR_Role")) ? dcRequest.getAttribute("CSR_Role") : "",
                "String"));
        usrAttr.addParam(new Param("CSR_Name",
                StringUtils.isNotBlank(dcRequest.getAttribute("CSR_Name")) ? dcRequest.getAttribute("CSR_Name") : "",
                "String"));
        usrAttr.addParam(new Param("CSR_Username",
                StringUtils.isNotBlank(dcRequest.getAttribute("CSR_Username")) ? dcRequest.getAttribute("CSR_Username")
                        : "",
                "String"));
        usrAttr.addParam(new Param("user_type",
                StringUtils.isNotBlank(dcRequest.getAttribute("CSRAssist_User_Type"))
                        ? dcRequest.getAttribute("CSRAssist_User_Type")
                        : "",
                "String"));
        usrAttr.addParam(new Param("CustomerUsername",
                StringUtils.isNotBlank(dcRequest.getAttribute("CSRAssist_Customer_username"))
                        ? dcRequest.getAttribute("CSRAssist_Customer_username")
                        : "",
                "String"));
        usrAttr.addParam(new Param("CustomerId",
                StringUtils.isNotBlank(dcRequest.getAttribute("CSRAssist_Customer_id"))
                        ? dcRequest.getAttribute("CSRAssist_Customer_id")
                        : "",
                "String"));
        usrAttr.addParam(new Param("accountId",
                StringUtils.isNotBlank(dcRequest.getAttribute("accountId"))
                        ? dcRequest.getAttribute("accountId")
                        : "",
                "String"));
        usrAttr.addParam(new Param("customerTypeId",
                StringUtils.isNotBlank(HelperMethods.getFieldValue(result, "CustomerType_id"))
                        ? HelperMethods.getFieldValue(result, "CustomerType_id")
                        : "",
                "String"));
dbp utilities_new
dbp utilities

Remove the below code as per the above snip,

sessionAttr.addParam(new Param("permissions",
    StringUtils.isNotBlank(dcRequest.getAttribute("permissions")) ? dcRequest.getAttribute("permissions")
            : "",
    "String"));

sessionAttr.addParam(new Param("features",
    StringUtils.isNotBlank(dcRequest.getAttribute("features")) ? dcRequest.getAttribute("features") : "",
    "String"));
dbputilities
dbp utilities

Remove the below code as per the above snip,

try {
            usrAttr.addParam(new Param("Lastlogintime", HelperMethods.convertDateFormat(
                    HelperMethods.getFieldValue(result, "CurrentLoginTime"), "yyyy-MM-dd'T'HH:mm:ss"), "String"));
        } catch (ParseException e) {

            logger.error("Caught exception while converting DateFormat: ", e);
        }

Mb changes for user_attibutes changes

Path:

Visualizer/CommonsMA/mvcextensions/AuthManager/BusinessControllers/BusinessController.js

Please replace the below given function,

AuthManager.prototype.getUserAttributes=function(presentationSuccess,presentationError)

With the below:

AuthManager.prototype.getUserAttributes = function(presentationSuccessCallback, presentationErrorCallback) {
      var accountsRepo = kony.mvc.MDAApplication.getSharedInstance().getRepoManager().getRepository("ExternalUsers");
      accountsRepo.customVerb('getUserAttributes', {}, getUserCompletionCallback);

      function getUserCompletionCallback(status, data, error) {
        var srh = applicationManager.getServiceResponseHandler();
        var obj = srh.manageResponse(status, data, error);
        if (obj["status"] === true) {
          if(obj["data"].user_attributes)
            obj["data"]=obj["data"].user_attributes;
          kony.sdk.getCurrentInstance().tokens[applicationManager.getConfigurationManager().constants.IDENTITYSERVICENAME].provider_token.params.user_attributes=obj["data"];
          presentationSuccessCallback(obj["data"]);
        } else {
          presentationErrorCallback(obj["errmsg"]);
        }
      }
    };

 

Copyright © 2020- Temenos Headquarters SA

Published on :
Sunday, March 23, 2025 5:14:04 PM IST